﻿using System;
using System.Linq;

namespace CrateMayhem.Common.Services
{
    public class MessageService : IMessageService
    {
        private static readonly string[] successMessages = new[]
            {
                "Good job",
                "The Hoff would be proud",
                "Simples",
                "I love it when a plan comes together",
                "Make it so number one",
                "Autobots! Transform and rollout!",
                "By the power of Grey Skull",
                "That's blockbusters",
                "Engage",
                "Loverly jubbly",
                "I don't believe it!",
                "Very nice",
                "Goonies never say die",
                "May the force be with you",
                "Hasta la vista…baby",
                "Elementary, my dear Watson",
                "Legend...wait for it...dary",
                "Awesome",
                "I completed that level. True story"
            };
        private static readonly string[] retryMessages = new[]
            {
                "Yeah that's right, have another go",
                "Kitt the turbo-boost has failed",
                "Kitt - ejector seat please",
                "Sergei, the computermabob has crashed!",
                "Shut down all the garbage mashers on the Detention Level!",
                "There's klingons on the starboard bow",
                "Cut that jibba jabba!",
                "D'oh",
                "Rodney you plonker",
                "I'll be back",
                "It's a trap",
                "How hard can it be?",
                "You are the weakest link!",
                "Challenge accepted"
            };
        private static readonly Random generator = new Random();

        public string RandomSuccess()
        {
            return successMessages.ElementAt(generator.Next(successMessages.Length));
        }

        public string RandomRetry()
        {
            return retryMessages.ElementAt(generator.Next(retryMessages.Length));
        }
    }
}